Skip to content

Add Support for Custom HTTP Headers in agent-python via Argument - #55

Open
BrunoTeixeira1996 wants to merge 8 commits into
hashtopolis:masterfrom
BrunoTeixeira1996:master
Open

Add Support for Custom HTTP Headers in agent-python via Argument#55
BrunoTeixeira1996 wants to merge 8 commits into
hashtopolis:masterfrom
BrunoTeixeira1996:master

Conversation

@BrunoTeixeira1996

Copy link
Copy Markdown

Hi guys,

I was using Hashtopolis inside a Docker container inside a VPS, however I wanted to integrated vast.ai to act as my agents and so for that I had to expose the VPS to the internet. That's not good in my opinion as we could get a lot of traffic from people trying to bruteforce the login form.

Knowing this I implemented a Cloud Flare Tunnel exposing port 8080 localy and assigned to a domain of my own - adding to this I also created an access rule that only people with a certain CF header can access that login form, thus making this login form protected.

Everything worked just fine however the agent-python was not prepared to deal with this kind of authentication since the requests being made dont use any kind of authentication mechanism and there's no argumment available to do this right now.

This pull request adds a new flag called http-headers that is optional but if used these headers will be used on the Session.py and jsonRequest.py thus making it possible to authenticate in the CF Tunnel and make requests to the Hashtopolis Server.

I tested all of this using vast.ai agents and everything worked just fine!

Please tell me if you guys need anything to be changed as I am willing to help

Thanks!

@s3inlc

s3inlc commented Sep 1, 2026

Copy link
Copy Markdown
Member

Thanks for creating this PR, I'll create a review now with some smaller adjustments needed.
If you could fix these and resolve the merge conflicts, then I'll happily merge it.

@s3inlc
s3inlc self-requested a review September 1, 2026 10:18

@s3inlc s3inlc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the README.md with the output of the --help command to also include the --http-headers flag. Also maybe state in the help text of the flag, how this needs to look like in format.

Comment thread build.sh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be an issue with these changes. The count does not count since the last tag but probably from the beginning. When I build on this branch, I get s3-python-0.7.3.781 as version (whereas the count should be something around 5-10 since 0.7.3).

… root

git describe would fail whenever tags aren't available locally (e.g. a
fork with no tags), and the old fallback counted commits since the very
first commit instead of since the last release tag, producing bogus
version suffixes like 0.7.3.781. Now it fetches tags best-effort and
falls back to count=0 (no suffix) if no tag can be found.
@BrunoTeixeira1996

Copy link
Copy Markdown
Author

@s3inlc I think everything its working as you wanted? Can you please confirm this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants